<template>
	<view class="page">
		<up-navbar title="我的分红" :autoBack="true" safeAreaInsetTop placeholder> </up-navbar>
		<view style="background-color: #fff;    height: 100rpx; ">
			<view style="width: 95%; margin: 0 auto;">
				<view class=" ">
					<view class="search-form round" @click="symtz">
						<image class="" src="/static/Frame@3x.png" alt=""
							style="width:35rpx;height:35rpx; margin-left: 20rpx;" />
						<input style="width: 73%;" v-model="order_no" :adjust-position="false" type="text"
							placeholder="请输入订单编号" confirm-type="search">
						<view class="action" @click="fenhong">
							<button class="sjign" >搜索</button>
						</view> </input>
					</view>

				</view>






			</view>
		</view>




		<view class="yanshi"  v-for="(item, index) in list" :key="index" @click="xinagqing(item.id)">
			<view style=" width: 95%; margin: 0 auto; padding: 20rpx; ">
				<view style="width: 100%; display: flex; ">
					<view class="neirngssf">
						<view style="line-height: 40rpx; font-size: 30rpx; font-weight: 900; "><text>订单编号:{{item.order_no}}</text></view>
					</view>
					
					<view class="neirngs" style="align-items: center; display: flex; justify-content: flex-end;">
						<view style=" display: flex;align-items: center;justify-content: center; ">
							<text style="color: #666666;">订单详情</text>
							<image class="" src="/static/Frameyoux.png" style="width:35rpx;height:35rpx; margin-left: 20rpx;" />
						</view>
					</view>
				</view>
				<view style="width: 100%; display: flex;">
					<view class="neirngssf">
						<view style="line-height: 40rpx;"><text style="color: #666666;">下单时间：{{item.createtime}}</text></view>
					</view>
					
					
				</view>
				<view style="width: 100%; display: flex;">
					<view class="neirngssf">
						<view style="line-height: 40rpx;"><text style="color: #666666;">分红金额:</text><text style="color: #FF7139;">¥{{item.my_money}}</text></view>
					</view>
					
					
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	// import {ref,getCurrentInstance } from "vue"
	// const {	proxy} = getCurrentInstance()

	// import {
	// 	onLoad
	// } from "@/utils/request.js"
	export default {
		data() {
			return {
		page: 1,
		limit: 10,
		order_no:'',
		list:[],
			}
		},
		onShow() {
			this.page=1
			this.fenhong()
			// console.log(onLoad)
		},
		methods: {
			
			xinagqing(id){
				uni.navigateTo({
				        url: '/pages/my/dingdan/dingdan_xiangqing/dingdan_xiangqing?id='+id
				      });
			},
			fenhong(){
					var insg = uni.getStorageSync('userinfo')
					
					console.log(insg,'1111')
					this.$request({
						url: '/api/User/getMyOrderMoneyLists',
						header:"application/x-www-form-urlencoded",
						data: {							
							type:insg.user_type,
							page: this.page,
							limit: this.limit,
							order_no:this.order_no
						}
					}).then(res => {
						if (res.code == 1) {
							console.log(res)
							this.list=res.data
						} else {
							
						
						}
					})
				
			},
			onReachBottom() {
				console.log(111)
				var insg = uni.getStorageSync('userinfo')
				var that = this
				uni.showLoading({
					title: '加载中...',
					mask: true //遮蔽层
				})
				console.log(1231123);
				that.page += 1;				
				this.$request({
					url: '/api/User/getMyOrderMoneyLists',
					header: "application/x-www-form-urlencoded",
					data: {
						type: insg.user_type,
						page: that.page,
						limit: that.limit,
					}
				}).then(res => {
					if (res.code == 1) {
						var feilei_neirong = res.data;
						console.log(res)
						if (feilei_neirong.length != 0) {
			
							feilei_neirong.forEach(rect => {
			
								that.list.push(rect);
							});
							console.log(that.list = that.list)
			
						
							uni.hideLoading()
						} else {
							uni.showToast({
								title: '没有更多的数据了',
								icon: 'none',
								duration: 2000
							});
						}
						// res.data.forEach((item, index) => {
						// 	item.avatars=request+item.avatar
						// });	
						// this.list=res.data
					} else {
			
			
					}
				})
			},
		
		},
		onReachBottom() {
			this.onReachBottom()
		}
	}
</script>

<style lang="scss" scoped>
	.sjign {

		position: relative;
		border: 0rpx;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		padding: 0 30rpx;
		font-size: 28rpx;
		height: 50rpx;
		line-height: 1;
		text-align: center;
		text-decoration: none;
		overflow: visible;
		margin-left: initial;
		-webkit-transform: translate(0rpx, 0rpx);
		transform: translate(0rpx, 0rpx);
		margin-right: initial;
		background-image: linear-gradient(to bottom, #FF9839, #FF7139);
		color: #333333;
		border-radius: 65rpx;
		height: 64rpx;
		color: #fff;


	}

	button::after {
		border: none;
	}

	.search-form {
		background-color: #f5f5f5;
		line-height: 32px;
		height: 64rpx;
		font-size: 24rpx;
		color: #333;
		flex: 1;
		display: flex;
		align-items: center;
		margin: 0 30rpx;
		border-radius: 60rpx;
	}

	.page {
		background: #F8F8F8;
	}
.yanshi:last-child {
  // border-bottom: 1px solid #ccc; /* 添加下边框 */
  margin-bottom: 20rpx;
}
	.yanshi {
		width: 95%;
		margin: 0 auto;
		margin-top: 20rpx;
		background-color: #fff;
		border-radius: 20rpx;
		
	}

	.neirngs {
		width: 30%;
		padding: 10rpx;
	}
	.neirngssf{
		width: 70%;
		padding: 10rpx;
		
	}
</style>